﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml;

namespace TestXmlRead
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            bool result = false;

            StreamReader textStreamReader;
            Assembly assembly = Assembly.GetExecutingAssembly();
            textStreamReader = new StreamReader(assembly.GetManifestResourceStream(assembly.GetName().Name
                + ".data.xml"));

            XmlDocument xmldoc2 = new XmlDocument();
            xmldoc2.Load(textStreamReader);

            XmlNodeList nodeList = xmldoc2.DocumentElement.SelectSingleNode("data").SelectSingleNode("path").SelectNodes("pathInfo");

            foreach (XmlNode node in nodeList)
            {
                XmlNode subAgeNode = node.SelectSingleNode("scantype");  //获取age子XmlElement集合  
                if (subAgeNode.InnerText.Equals("签收"))
                {
                    result = true;
                    break;
                }
            }

        }
    }
}
